/*
 * Amazon Ads API - Sponsored Products
 * Use the Amazon Ads API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the [Sponsored Products Support Center](https://advertising.amazon.com/help?entityId=ENTITY3CWETCZD9HEG2#GWGFKPEWVWG2CLUJ). For onboarding information, see the [account setup](setting-up/account-setup) topic.<br/><br/> 
 *
 * The version of the OpenAPI document: 2.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.api;

import org.openapitools.client.ApiCallback;
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.Pair;
import org.openapitools.client.ProgressRequestBody;
import org.openapitools.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import org.openapitools.client.model.AdGroupBidRecommendationsResponse;
import org.openapitools.client.model.BidRecommendationsResponse;
import java.math.BigDecimal;
import org.openapitools.client.model.Error;
import org.openapitools.client.model.InlineObject1;
import org.openapitools.client.model.InlineResponse200;
import org.openapitools.client.model.KeywordBidRecommendationsData;
import org.openapitools.client.model.KeywordBidRecommendationsResponse;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class BidRecommendationsApi {
    private ApiClient localVarApiClient;

    public BidRecommendationsApi() {
        this(Configuration.getDefaultApiClient());
    }

    public BidRecommendationsApi(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    /**
     * Build call for createKeywordBidRecommendations
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordBidRecommendationsData An array of keyword bid recommendation objects. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 207 </td><td> Multi-status. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call createKeywordBidRecommendationsCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, KeywordBidRecommendationsData keywordBidRecommendationsData, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = keywordBidRecommendationsData;

        // create path and map variables
        String localVarPath = "/v2/sp/keywords/bidRecommendations";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call createKeywordBidRecommendationsValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, KeywordBidRecommendationsData keywordBidRecommendationsData, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling createKeywordBidRecommendations(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling createKeywordBidRecommendations(Async)");
        }
        

        okhttp3.Call localVarCall = createKeywordBidRecommendationsCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordBidRecommendationsData, _callback);
        return localVarCall;

    }

    /**
     * Gets bid recommendations for keywords.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordBidRecommendationsData An array of keyword bid recommendation objects. (optional)
     * @return BidRecommendationsResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 207 </td><td> Multi-status. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public BidRecommendationsResponse createKeywordBidRecommendations(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, KeywordBidRecommendationsData keywordBidRecommendationsData) throws ApiException {
        ApiResponse<BidRecommendationsResponse> localVarResp = createKeywordBidRecommendationsWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordBidRecommendationsData);
        return localVarResp.getData();
    }

    /**
     * Gets bid recommendations for keywords.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordBidRecommendationsData An array of keyword bid recommendation objects. (optional)
     * @return ApiResponse&lt;BidRecommendationsResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 207 </td><td> Multi-status. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<BidRecommendationsResponse> createKeywordBidRecommendationsWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, KeywordBidRecommendationsData keywordBidRecommendationsData) throws ApiException {
        okhttp3.Call localVarCall = createKeywordBidRecommendationsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordBidRecommendationsData, null);
        Type localVarReturnType = new TypeToken<BidRecommendationsResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Gets bid recommendations for keywords. (asynchronously)
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordBidRecommendationsData An array of keyword bid recommendation objects. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 207 </td><td> Multi-status. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call createKeywordBidRecommendationsAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, KeywordBidRecommendationsData keywordBidRecommendationsData, final ApiCallback<BidRecommendationsResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = createKeywordBidRecommendationsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordBidRecommendationsData, _callback);
        Type localVarReturnType = new TypeToken<BidRecommendationsResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getAdGroupBidRecommendations
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param adGroupId The identifier of an existing ad group. (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Either the specified ad group identifier was not found, or the specified ad group was found but no associated bid was found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getAdGroupBidRecommendationsCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/v2/sp/adGroups/{adGroupId}/bidRecommendations"
            .replaceAll("\\{" + "adGroupId" + "\\}", localVarApiClient.escapeString(adGroupId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getAdGroupBidRecommendationsValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling getAdGroupBidRecommendations(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling getAdGroupBidRecommendations(Async)");
        }
        
        // verify the required parameter 'adGroupId' is set
        if (adGroupId == null) {
            throw new ApiException("Missing the required parameter 'adGroupId' when calling getAdGroupBidRecommendations(Async)");
        }
        

        okhttp3.Call localVarCall = getAdGroupBidRecommendationsCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, adGroupId, _callback);
        return localVarCall;

    }

    /**
     * Gets a bid recommendation for an ad group.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param adGroupId The identifier of an existing ad group. (required)
     * @return AdGroupBidRecommendationsResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Either the specified ad group identifier was not found, or the specified ad group was found but no associated bid was found. </td><td>  -  </td></tr>
     </table>
     */
    public AdGroupBidRecommendationsResponse getAdGroupBidRecommendations(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId) throws ApiException {
        ApiResponse<AdGroupBidRecommendationsResponse> localVarResp = getAdGroupBidRecommendationsWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, adGroupId);
        return localVarResp.getData();
    }

    /**
     * Gets a bid recommendation for an ad group.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param adGroupId The identifier of an existing ad group. (required)
     * @return ApiResponse&lt;AdGroupBidRecommendationsResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Either the specified ad group identifier was not found, or the specified ad group was found but no associated bid was found. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<AdGroupBidRecommendationsResponse> getAdGroupBidRecommendationsWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId) throws ApiException {
        okhttp3.Call localVarCall = getAdGroupBidRecommendationsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, adGroupId, null);
        Type localVarReturnType = new TypeToken<AdGroupBidRecommendationsResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Gets a bid recommendation for an ad group. (asynchronously)
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param adGroupId The identifier of an existing ad group. (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Either the specified ad group identifier was not found, or the specified ad group was found but no associated bid was found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getAdGroupBidRecommendationsAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal adGroupId, final ApiCallback<AdGroupBidRecommendationsResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = getAdGroupBidRecommendationsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, adGroupId, _callback);
        Type localVarReturnType = new TypeToken<AdGroupBidRecommendationsResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getBidRecommendations
     * @param inlineObject1  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getBidRecommendationsCall(InlineObject1 inlineObject1, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = inlineObject1;

        // create path and map variables
        String localVarPath = "/v2/sp/targets/bidRecommendations";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getBidRecommendationsValidateBeforeCall(InlineObject1 inlineObject1, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = getBidRecommendationsCall(inlineObject1, _callback);
        return localVarCall;

    }

    /**
     * Gets a list of bid recommendations for keyword, product, or auto targeting expressions.
     * 
     * @param inlineObject1  (optional)
     * @return InlineResponse200
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
     </table>
     */
    public InlineResponse200 getBidRecommendations(InlineObject1 inlineObject1) throws ApiException {
        ApiResponse<InlineResponse200> localVarResp = getBidRecommendationsWithHttpInfo(inlineObject1);
        return localVarResp.getData();
    }

    /**
     * Gets a list of bid recommendations for keyword, product, or auto targeting expressions.
     * 
     * @param inlineObject1  (optional)
     * @return ApiResponse&lt;InlineResponse200&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<InlineResponse200> getBidRecommendationsWithHttpInfo(InlineObject1 inlineObject1) throws ApiException {
        okhttp3.Call localVarCall = getBidRecommendationsValidateBeforeCall(inlineObject1, null);
        Type localVarReturnType = new TypeToken<InlineResponse200>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Gets a list of bid recommendations for keyword, product, or auto targeting expressions. (asynchronously)
     * 
     * @param inlineObject1  (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getBidRecommendationsAsync(InlineObject1 inlineObject1, final ApiCallback<InlineResponse200> _callback) throws ApiException {

        okhttp3.Call localVarCall = getBidRecommendationsValidateBeforeCall(inlineObject1, _callback);
        Type localVarReturnType = new TypeToken<InlineResponse200>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getKeywordBidRecommendations
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing keyword. (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getKeywordBidRecommendationsCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/v2/sp/keywords/{keywordId}/bidRecommendations"
            .replaceAll("\\{" + "keywordId" + "\\}", localVarApiClient.escapeString(keywordId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getKeywordBidRecommendationsValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling getKeywordBidRecommendations(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling getKeywordBidRecommendations(Async)");
        }
        
        // verify the required parameter 'keywordId' is set
        if (keywordId == null) {
            throw new ApiException("Missing the required parameter 'keywordId' when calling getKeywordBidRecommendations(Async)");
        }
        

        okhttp3.Call localVarCall = getKeywordBidRecommendationsCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId, _callback);
        return localVarCall;

    }

    /**
     * Gets a bid recommendation for a keyword.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing keyword. (required)
     * @return KeywordBidRecommendationsResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
     </table>
     */
    public KeywordBidRecommendationsResponse getKeywordBidRecommendations(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId) throws ApiException {
        ApiResponse<KeywordBidRecommendationsResponse> localVarResp = getKeywordBidRecommendationsWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId);
        return localVarResp.getData();
    }

    /**
     * Gets a bid recommendation for a keyword.
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing keyword. (required)
     * @return ApiResponse&lt;KeywordBidRecommendationsResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<KeywordBidRecommendationsResponse> getKeywordBidRecommendationsWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId) throws ApiException {
        okhttp3.Call localVarCall = getKeywordBidRecommendationsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId, null);
        Type localVarReturnType = new TypeToken<KeywordBidRecommendationsResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Gets a bid recommendation for a keyword. (asynchronously)
     * 
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param keywordId The identifier of an existing keyword. (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 400 </td><td> Bad request. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getKeywordBidRecommendationsAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal keywordId, final ApiCallback<KeywordBidRecommendationsResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = getKeywordBidRecommendationsValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, keywordId, _callback);
        Type localVarReturnType = new TypeToken<KeywordBidRecommendationsResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
}
